<?php

class Application_Form_Venue extends Zend_Form {

    public function init() {
        $this->setAction('/venue/validate')
                ->setMethod('post')
                ->setAttrib('id', 'venueForm')
                ->setDecorators(MusicEvent_Decorator_Decorator::Form());

        /* Venue */
        $this->addElement('text', 'venue', array(
            'decorators' => MusicEvent_Decorator_Decorator::MultiLineElement(),
            'label' => 'Venue',
            'validators' => array(
                array('NotEmpty', true, array(
                        'messages' => 'Insert an venue',
                ))),
            'filter' => 'StripTags',
            'required' => true,
            'attribs' => array(
                'class' => 'large'
            ),
        ));

        /* Country */
        $this->addElement('select', 'country', array(
            'decorators' => MusicEvent_Decorator_Decorator::MultiLineElement(),
            'label' => 'Country',
            'multiOptions' => Application_Model_Country::getCountries(),
            'attribs' => array(
                'class' => 'large'
            ),
        ));

        /* search button */
        $this->addElement('submit', 'Search', array(
            'decorators' => MusicEvent_Decorator_Decorator::Submit()
        ));
    }

}

